import request from './request.js'
import urls from './urls.js'

const post = {};
// console.log(urls,'urlsurls');

urls.forEach(module => {
    post[module.moduleName] = {};
    // console.log(post[module.moduleName],'modulemodule');
    module.urls.forEach(url => {
        // 生成异步请求方法
        post[module.moduleName][url.name] = data => request({
            url: url.url,
            method: url.type,
            data,
            headers:{
                // 'Content-Type': 'application/json'
            }
        })
    })
});

export default post;